<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.*,util.*,model.*,control.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>处理</title>
</head>

<body> 
<%
	request.setCharacterEncoding("utf-8");	
	String sna = ParamUtil.getString(request, "sna");
	String pas = ParamUtil.getString(request, "pas");
	String sx = ParamUtil.getString(request, "sx");
	String sc = ParamUtil.getString(request, "sc");
	String cl = ParamUtil.getString(request, "cl");
	String ma = ParamUtil.getString(request, "ma");
	String al = ParamUtil.getString(request, "al");
	int id = ParamUtil.getInt(request,"id");
	
	Student student = new Student();
	StudentControl scc = new StudentControl();
	
	student.setStudentName(sna);
	student.setPassword(pas);
	student.setSex(sx);
	student.setSchool(sc);
	student.setClasses(cl);
	student.setMajor(ma);
	student.setAlt1(al);
	
	
	/*System.out.println(sno);
	System.out.println(sna);
	System.out.println(pas);
	System.out.println(sx);
	System.out.println(sc);
	System.out.println(cl);
	System.out.println(ma);
	System.out.println(al);
	System.out.println("id:" + id);
	*/
	
	if(scc.updateStudent(student, id))
	{
	%>
		
	<script language="javascript">
     alert("修改成功");
     window.location.href="student_list.jsp";
    </script>
	
	<%
	} else { 
	%>
	
	<script language="javascript">
     alert("修改失败");
     window.location.href="student_update.jsp?id=<%=id%>";
    </script>
	<%} %>
	



</body>
</html>